﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;//This is about DllImport.
namespace WPFExcelReport
{
    public static class ITXTTFAPI
    {
        [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
        public static extern IntPtr LoadImage(IntPtr hinst, string lpszName, uint uType,
           int cxDesired, int cyDesired, uint fuLoad);
        [DllImport("Gdi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
        public static extern int DeleteObject(IntPtr ho); 
        [DllImport("Winpplb.dll")]
        public static extern int B_Bar2d_Maxi(int x, int y, int cl, int cc, int pc, string data);
        [DllImport("Winpplb.dll")]
        public static extern int B_Bar2d_PDF417(int x, int y, int w, int v, int s, int c, int px,
            int py, int r, int l, int t, int o, string data);
        [DllImport("Winpplb.dll")]
        public static extern int B_Bar2d_PDF417_N(int x, int y, int w, string para, string data);
        [DllImport("Winpplb.dll")]
        public static extern void B_ClosePrn();
        [DllImport("Winpplb.dll")]
        public static extern int B_CreatePrn(int selection, string filename);
        [DllImport("Winpplb.dll")]
        public static extern int B_Del_Form(string formname);
        [DllImport("Winpplb.dll")]
        public static extern int B_Del_Pcx(string pcxname);
        [DllImport("Winpplb.dll")]
        public static extern int B_Draw_Box(int x, int y, int thickness, int hor_dots,
            int ver_dots);
        [DllImport("Winpplb.dll")]
        public static extern int B_Draw_Line(char mode, int x, int y, int hor_dots, int ver_dots);
        [DllImport("Winpplb.dll")]
        public static extern int B_Error_Reporting(char option);
        [DllImport("Winpplb.dll")]
        public static extern string B_Get_DLL_Version(int nShowMessage);
        [DllImport("Winpplb.dll")]
        public static extern int B_Get_DLL_VersionA(int nShowMessage);
        [DllImport("Winpplb.dll")]
        public static extern int B_Get_Graphic_ColorBMP(int x, int y, string filename);
        [DllImport("Winpplb.dll")]
        public  static extern int B_Get_Graphic_ColorBMPEx(int x, int y, int nWidth, int nHeight,
            int rotate, string id_name, string filename);
        [DllImport("Winpplb.dll")]
        public  static extern int B_Get_Graphic_ColorBMP_HBitmap(int x, int y, int nWidth, int nHeight,
           int rotate, string id_name, IntPtr hbm);
        [DllImport("Winpplb.dll")]
        public static extern int B_Get_Pcx(int x, int y, string filename);
        [DllImport("Winpplb.dll")]
        public static extern int B_Initial_Setting(int Type, string Source);
        [DllImport("Winpplb.dll")]
        public static extern int B_WriteData(int IsImmediate, byte[] pbuf, int length);
        [DllImport("Winpplb.dll")]
        public static extern int B_ReadData(byte[] pbuf, int length, int dwTimeoutms);
        [DllImport("Winpplb.dll")]
        public static extern int B_Load_Pcx(int x, int y, string pcxname);
        [DllImport("Winpplb.dll")]
        public static extern int B_Open_ChineseFont(string path);
        [DllImport("Winpplb.dll")]
        public static extern int B_Print_Form(int labset, int copies, string form_out, string var);
        [DllImport("Winpplb.dll")]
        public static extern int B_Print_MCopy(int labset, int copies);
        [DllImport("Winpplb.dll")]
        public static extern int B_Print_Out(int labset);
        [DllImport("Winpplb.dll")]
        public static extern int B_Prn_Barcode(int x, int y, int ori, string type, int narrow,
            int width, int height, char human, string data);
        [DllImport("Winpplb.dll")]
        public static extern void B_Prn_Configuration();
        [DllImport("Winpplb.dll")]
        public static extern int B_Prn_Text(int x, int y, int ori, int font, int hor_factor,
            int ver_factor, char mode, string data);
        [DllImport("Winpplb.dll")]
        public static extern int B_Prn_Text_Chinese(int x, int y, int fonttype, string id_name,
            string data);
        [DllImport("Winpplb.dll")]
        public static extern int B_Prn_Text_TrueType(int x, int y, int FSize, string FType,
            int Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut, string id_name,
            string data);
        [DllImport("Winpplb.dll")]
        public static extern int B_Prn_Text_TrueType_W(int x, int y, int FHeight, int FWidth,
            string FType, int Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut,
            string id_name, string data);
        [DllImport("Winpplb.dll")]
        public static extern int B_Select_Option(int option);
        [DllImport("Winpplb.dll")]
        public static extern int B_Select_Option2(int option, int p);
        [DllImport("Winpplb.dll")]
        public static extern int B_Select_Symbol(int num_bit, int symbol, int country);
        [DllImport("Winpplb.dll")]
        public static extern int B_Select_Symbol2(int num_bit, string csymbol, int country);
        [DllImport("Winpplb.dll")]
        public static extern int B_Set_Backfeed(char option);
        [DllImport("Winpplb.dll")]
        public static extern int B_Set_BMPSave(int nSave, string strBMPFName);
        [DllImport("Winpplb.dll")]
        public static extern int B_Set_Darkness(int darkness);
        [DllImport("Winpplb.dll")]
        public static extern int B_Set_DebugDialog(int nEnable);
        [DllImport("Winpplb.dll")]
        public static extern int B_Set_Direction(char direction);
        [DllImport("Winpplb.dll")]
        public static extern int B_Set_Form(string formfile);
        [DllImport("Winpplb.dll")]
        public static extern int B_Set_Labgap(int lablength, int gaplength);
        [DllImport("Winpplb.dll")]
        public static extern int B_Set_Labwidth(int labwidth);
        [DllImport("Winpplb.dll")]
        public static extern int B_Set_Originpoint(int hor, int ver);
        [DllImport("Winpplb.dll")]
        public static extern int B_Set_Prncomport(int baud, char parity, int data, int stop);
        [DllImport("Winpplb.dll")]
        public static extern int B_Set_Prncomport_PC(int nBaudRate, int nByteSize, int nParity,
            int nStopBits, int nDsr, int nCts, int nXonXoff);
        [DllImport("Winpplb.dll")]
        public static extern int B_Set_Speed(int speed);
        [DllImport("Winpplb.dll")]
        public static extern int B_Set_ProcessDlg(int nShow);
        [DllImport("Winpplb.dll")]
        public static extern int B_GetUSBBufferLen();
        [DllImport("Winpplb.dll")]
        public static extern int B_EnumUSB(byte[] buf);
        [DllImport("Winpplb.dll")]
        public  static extern int B_CreateUSBPort(int nPort);
        [DllImport("Winpplb.dll")]
        public  static extern int B_ResetPrinter();
        [DllImport("Winpplb.dll")]
        public  static extern int B_GetPrinterResponse(byte[] buf, int nMax);
        [DllImport("Winpplb.dll")]
        public  static extern int B_TFeedMode(int nMode);
        [DllImport("Winpplb.dll")]
        public  static extern int B_TFeedTest();
        [DllImport("Winpplb.dll")]
        public  static extern int B_CreatePort(int nPortType, int nPort, string filename);
        [DllImport("Winpplb.dll")]
        public  static extern int B_Execute_Form(string form_out, string var);
        [DllImport("Winpplb.dll")]
        public  static extern int B_Bar2d_QR(int x, int y, int model, int scl, char error,
            char dinput, int c, int d, int p, string data);
        [DllImport("Winpplb.dll")]
        public  static extern int B_GetNetPrinterBufferLen();
        [DllImport("Winpplb.dll")]
        public  static extern int B_EnumNetPrinter(byte[] buf);
        [DllImport("Winpplb.dll")]
        public  static extern int B_CreateNetPort(int nPort);
        [DllImport("Winpplb.dll")]
        public  static extern int B_Prn_Text_TrueType_Uni(int x, int y, int FSize, string FType,
            int Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut, string id_name,
            byte[] data, int format);
        [DllImport("Winpplb.dll")]
        public  static extern int B_Prn_Text_TrueType_UniB(int x, int y, int FSize, string FType,
            int Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut, string id_name,
            byte[] data, int format);
        [DllImport("Winpplb.dll")]
        public  static extern int B_GetUSBDeviceInfo(int nPort, byte[] pDeviceName,
            out int pDeviceNameLen, byte[] pDevicePath, out int pDevicePathLen);
        [DllImport("Winpplb.dll")]
        public  static extern int B_Set_EncryptionKey(string encryptionKey);
        [DllImport("Winpplb.dll")]
        public  static extern int B_Check_EncryptionKey(string decodeKey, string encryptionKey,
            int dwTimeoutms);
    }
}
